package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.wx.storage.vo.StorageVo;
import com.cskaoyan.service.wx.WxStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Name : WxStorageController.java
 * @Time : 2021/8/14 14:46
 * @Author : creamycandy
 * @Software : IntelliJ IDEA
 */
@RestController
@RequestMapping("wx/storage")
public class WxStorageController {

    @Autowired
    WxStorageService wxStorageService;

    @RequestMapping("upload")
    public BaseRespVo upload(@RequestParam("file") MultipartFile uploadFile){
        StorageVo upload = wxStorageService.upload(uploadFile);
        return BaseRespVo.ok(upload);
    }
}
